﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore.Migrations;
using WebApplication1.Controllers.Demain;
using WebApplication1.Demain.Hellper;
using WebApplication1.Demain.Hellper.Interface;

namespace WebApplication1.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : ControllerBase
    {
        private readonly IRespository<Student> Stu_Respository;

        public TestController(IRespository<Student> StuRespository)
        {
            Stu_Respository = StuRespository;
        }

        public string Get()
        {
            var list = Stu_Respository.Table.ToList();
            return JsonHellper.SerializeObject(list);
        }
    }
}
